package com.bsgogogo.dao;

import com.bsgogogo.entity.UserInfo;
import com.bsgogogo.vo.UserInfoVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface UserInfoDao extends Mapper<UserInfo> {
    //用姓名来查询 返回List集合
    List<UserInfoVo> findByName(@Param("name") String name);

    //查询重复 遍历数据库表 查询
    int checkRepeat(@Param("column")String column, @Param("value")String value,@Param("id")Long id);

    //也用姓名来查询 返回单个UserInfo对象
    UserInfoVo findByUsername(@Param("username")String username);

    //返回用户表用户数量
    Integer count();
}
